package com.dolphin.servicemap.service;

import com.dolphin.common.dto.ResponseResult;
import com.dolphin.common.dto.TrsearchResponse;
import com.dolphin.common.response.TerminalResponse;
import com.dolphin.servicemap.remot.TerminalClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TerminalService {
    @Autowired
    TerminalClient terminalClient;

    /**
     * 创建终端
     * @param name
     * @return
     */
    public ResponseResult add(String name,String desc) {
        ResponseResult result = terminalClient.add(name,desc);
        return result;
    }

    public ResponseResult<List<TerminalResponse>> aroundSearch(String center, Integer radius) {
        ResponseResult result = terminalClient.aroundSearch(center,radius);
        return result;
    }

    public ResponseResult<TrsearchResponse> trsearch(String tid, Long startTime, Long endTime) {
        return terminalClient.trsearch(tid,startTime,endTime);

    }
}
